﻿//------------------------------------------------------------
// AureFramework
// Developed By Drunk Fish
// GitHub: https://github.com/YYYurz
// Gitee: https://gitee.com/yyyurz
//------------------------------------------------------------

using AureFramework.Event;
using AureFramework.ReferencePool;

namespace AureFramework.Network
{
	public class NetworkConnectedEventArgs : AureEventArgs
	{
		public INetworkChannel NetworkChannel
		{
			get;
			private set;
		}

		public object UserData
		{
			get;
			private set;
		}
		
		public static NetworkConnectedEventArgs Create(INetworkChannel networkChannel, object userData)
		{
			var networkConnectedEventArgs = Aure.GetModule<IReferencePoolModule>().Acquire<NetworkConnectedEventArgs>();
			networkConnectedEventArgs.NetworkChannel = networkChannel;
			networkConnectedEventArgs.UserData = userData;
			
			return networkConnectedEventArgs;
		}
		
		public override void Clear()
		{
			NetworkChannel = null;
			UserData = null;
		}
	}
}